function SearchView() {
	
	var sv = this;
    this.table = document.createElement('table');

	
	this.addRow = function(row) {
		
		var tr = document.createElement('tr');
		
        var td1 = document.createElement('td');
		$(td1).html(row["model"]);
		tr.appendChild(td1);
                
        var td2 = document.createElement('td');
		$(td2).html(row["output_year"]);
		tr.appendChild(td2);
                
        var td3 = document.createElement('td');
		$(td3).html(row["price"]);
		tr.appendChild(td3);

        var td4 = document.createElement('td');
		$(td4).html(row["insurance"]);
		tr.appendChild(td4);
                
        var td5 = document.createElement('td');
		$(td5).html(row["start_place"]);
		tr.appendChild(td5);
                
                
		var action = '<div>\n\
			<a href="order_view.htm?id='+row["id"]+'">View</a>\n\
		</div>';

		var td6 = document.createElement('td');
		$(td6).html(action);
		tr.appendChild(td6);
		
		sv.table.appendChild(tr);
	},
	
	this.reloadGreed = function(list) {
		$(this.table).html("");
		for (var key in list) {
			
			var item = new Object();
            item["id"] = list[key].id;
			item["model"] = list[key].model;
			item["output_year"] = list[key].output_year;
			item["price"] = list[key].price;
            item["insurance"] = list[key].insurance;
            item["start_place"] = list[key].start_place;
            
			sv.addRow(item);
		}
		$("#search_list").append(sv.table);
	}
        
        
}

